import Vue from 'vue'
import Router from 'vue-router'
import CommonHead from '@/components/Common/CommonHead'
import Login from '@/components/Login'
import sign from '@/components/sign'
import Home from '@/components/Home'
import register from '@/components/register'
import setting from '@/components/user/setting'
import basic from '@/components/user/basic'
import profile from '@/components/user/profile'
import blacklist from '@/components/user/blacklist'
import reward from '@/components/user/reward'
import misc from '@/components/user/misc'
import HomePage from '@/components/HomePage'
import HomeMessage from '@/components/HomeMessage'
import Attention from '@/components/Attention'
import Fans from '@/components/Fans'
import AttentionTopic from '@/components/AttentionTopic'
import FavoriteArticle from '@/components/FavoriteArticle'
import message from '@/components/Message/message'
import comment from '@/components/Message/comment'
import SimpleLetter from '@/components/Message/SimpleLetter'
import contribute from '@/components/Message/contribute'
import ReceivedLike from '@/components/Message/ReceivedLike'
import AllAttention from '@/components/Message/AllAttention'
import payment from '@/components/Message/payment'
import OtherRemind from '@/components/Message/OtherRemind'
import CollectedArticles from '@/components/CollectedArticles'
import paid from '@/components/paid/paid'
import PaidArticle from '@/components/paid/PaidArticle'
import PaidSerialize from '@/components/paid/PaidSerialize'
import wallet from '@/components/wallet'
import ITtechnology from '@/components/ITtechnology'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    // 首页
    {
      path: '/home',
      name: 'Home',
      component: Home,
    },
    // 登录注册
    {
      path: '/sign',
      name: 'sign',
      component: sign,
      children: [
        // 登录
        {
          path: 'login',
          component: Login,
        },
        // 注册
        {
          path: 'register',
          component: register,
        }
      ]
    },
    // 设置
    {
      path: '/setting',
      name: 'setting',
      component: setting,
      children: [
        {
          path: 'basic',
          component: basic,
        },
        {
          path: 'profile',
          component: profile,
        },
        {
          path: 'blacklist',
          component: blacklist,
        },
        {
          path: 'reward',
          component: reward,
        },
        {
          path: 'misc',
          component: misc,
        },
      ]
    },
    // 我的主页
    {
      path: '/homepage',
      name: 'HomePage',
      component: HomePage,
      children: [
        {
          path: 'homemessage',
          component: HomeMessage,
        }, {
          path: 'attention',
          component: Attention,
        }, {
          path: 'fans',
          component: Fans,
        }, {
          path: 'attentiontopic',
          component: AttentionTopic,
        }, {
          path: 'favoritearticle',
          component: FavoriteArticle,
        },
      ]
    },
    // 消息
    {
      path: '/message',
      name: 'message',
      component: message,
      children: [
        // 评论
        {
          path: 'comment',
          component: comment,
        },
        // 简信
        {
          path: 'simpleletter',
          component: SimpleLetter,
        },
        // 投稿请求
        {
          path: 'contribute',
          component: contribute,
        },// 喜欢和赞
        {
          path: 'receivedlike',
          component: ReceivedLike,
        },// 关注
        {
          path: 'allattention',
          component: AllAttention,
        },// 赞赏和付费
        {
          path: 'payment',
          component: payment,
        },// 赞赏和付费
        {
          path: 'otherremind',
          component: OtherRemind,
        },
      ]
    },
    // 收藏的文章
    {
      path: '/collectedarticles',
      name: 'CollectedArticles',
      component: CollectedArticles,
    },
    // 已购内容
    {
      path: '/paid',
      name: 'paid',
      component: paid,
      children: [
        // 已购文章
        {
          path: 'paidarticle',
          component: PaidArticle,
        },
        // 已购连载
        {
          path: 'paidserialize',
          component: PaidSerialize,
        },
      ]
    },
    // 钱包
    {
      path: '/wallet',
      name: 'wallet',
      component: wallet,
    },
    // IT技术
    {
      path: '/ittechnology',
      name: 'ITtechnology',
      component: ITtechnology,
    },
  ]
})
